import Vue from 'vue';
import {Toast} from "vant";

Vue.use(Toast);

const mask = {
    num: 0,
    open() {
        if (++this.num == 1) {
            Toast.loading({
                duration: 0,
                forbidClick: true,
            });
        }
    },
    close() {
        if (--this.num < 1) {
            this.num = 0;
            Toast.clear();
        }
    },
};

export default mask;
